Repository navigation
feat: toxicity penalty tests — Phase 2 benchmark honesty - #10
Closed
cschanhniem wants to merge 1 commit into
Closed
cschanhniem wants to merge 1 commit into
cschanhniem wants to merge 1 commit into
Conversation
Phase 2: Toxicity penalty — predicted hemolytic/toxic candidates are down-ranked. - Add test_toxicity_penalty.py: 13 tests covering the full toxicity penalty mechanism: Safety scorer penalty signals: - Hydrophobic fraction > 0.65 → hemolysis proxy penalty - Charge density > 0.55 → toxicity proxy penalty - Length > 35 aa → stability and synthesis penalty - Cysteine fraction > 0.25 → disulfide complexity penalty - Longest repeat run ≥ 6 → degenerate composition penalty Tests verify: - Extreme hydrophobicity reduces safety score (<0.6) - Extreme charge density reduces safety score (<0.6) - High cysteine fraction reduces safety (<0.9) - Very long sequences penalized - Long repeat runs penalized - All balanced AMP candidates score higher safety than poly-hydrophobic sequences - All balanced AMP candidates score higher safety than poly-cationic sequences - Monotonic safety reduction with increasing excess hydrophobicity - Double penalty (charge + repeat run) on poly-K - Mean AMP ensemble > mean high-risk ensemble in full pipeline - All AMPs outrank all high-risk candidates - Toxicity penalty propagates correctly through pipeline safety field - High-risk candidates excluded with strict max_safety_risk filter - Fix ruff F401 unused imports (pipeline.py, test_cli.py, test_pipeline_filters.py) - 50 tests passing, ruff clean
Merged
7 tasks done
Collaborator
Author
|
Superseded by PR #11 (feat/integrate-all-phases), which merges all Phase 2 + Phase 3 work into a single consolidation PR with 251 tests passing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Phase 2: Toxicity penalty from AGENTS.md:
Safety scorer penalty signals tested
(hydro - 0.65) × 1.8(charge - 0.55) × 1.2+0.25+0.20+0.15These are computational proxies only. No biological safety claim is made.
What the tests prove
safetyfield in pipeline outputTest plan
make test— 50 tests passruff check src tests— clean